//
//  UIImage+expand.m
//  0907-weather
//
//  Created by zhoubaitong on 2017/9/7.
//  Copyright © 2017年 cckv. All rights reserved.
//

#import "UIImage+expand.h"

@implementation UIImage (expand)
- (UIImage *)imageByTintColor:(UIColor *)color {
    
    UIGraphicsBeginImageContextWithOptions(self.size, NO, [UIScreen mainScreen].scale);
    CGRect rect = CGRectMake(0, 0, self.size.width, self.size.height);
    [color set];
    UIRectFill(rect);
    [self drawAtPoint:CGPointMake(0, 0) blendMode:kCGBlendModeDestinationIn alpha:1];
    UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return newImage;
}
@end
